package hotciv.standard;

import hotciv.framework.*;

/**  
 * 	Standard implementation of a unit.
 **/
public class StandardUnit implements Unit {

  protected String type;
  protected Player owner;
  protected int moveCount;
  
  public StandardUnit( String type, Player owner ) {
    this.type = type;
    this.owner = owner;
    this.moveCount = 1;
  }
  
  public Player getOwner() {
    return owner;
  }

  public int getMoveCount() {
	  System.out.println(this.owner+" has "+this.moveCount+" moves left.");
    return this.moveCount;
  }

  public void decrementMoveCount() {
	  this.moveCount--;
  }
  public void resetMoveCount() {
    this.moveCount = 1;
  }
  
  public int getAttackingStrength() {
	  if(type.equals(GameConstants.ARCHER))
		  return 2;
	  if(type.equals(GameConstants.LEGION))
		  return 4;
	  return 0;
  }

  public int getDefensiveStrength() {
	  if(type.equals(GameConstants.ARCHER))
		  return 3;
	  if(type.equals(GameConstants.LEGION))
		  return 2;
	  return 0;
  }

  public String getTypeString() {
    return type;
  }
}
